<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/10/13
 * Time: 9:22
 */
namespace app\index\model;
use think\Model;

class Profile extends Model{
    protected $type = [
        'birthday' => 'timestamp:Y-m-d',
    ];

    //开启自动写入时间戳,关闭，标User中有时间戳，而标profile中没有，而user关联了profile,所以这里要把时间自动写入关闭。
    protected  $autoWriteTimestamp = false;

    //关联user
    public function user(){
        return $this->belongsTo('user');
    }
}